package com.sumainfor.pc.gmio.controller.secretary;

import com.sumainfor.common.util.JsonResult;
import com.sumainfor.common.utlis.Pager;
import com.sumainfor.pc.gmio.service.HoGasMeterService;
import com.sumainfor.pc.gmio.service.SeGasMeterExtService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * @author zc
 * @ClassName SeGasMeterExtController
 * @date 2019/11/21 18:18
 * @description: TODO
 */
@Controller
@RequestMapping("/SeGasMeterExt")
public class SeGasMeterExtController {

    @Autowired
    SeGasMeterExtService seGasMeterExtService;

    @Autowired
    HoGasMeterService hoGasMeterService;

    /**
     * 根据房源编号和角色查询上期读数
     * @param params
     * @return
     */
    @ResponseBody
    @PostMapping("/getHouInfoGas")
    public JsonResult getHouInfoGas(@RequestBody Map<String,Object> params){
        return hoGasMeterService.getHouInfoGas(params);
    }

    /**
     * 管家抄表需要抄表的房源及其最近一次的抄表数
     * @param params
     * @param pager
     * @return
     */
    @ResponseBody
    @PostMapping("/getGasMeterNum")
    public JsonResult getGasMeterNum(@RequestBody Map<String,Object> params, Pager pager){
        return seGasMeterExtService.getGasMeterNum(params,pager);
    }

    /**
     * 秘书抄燃气的房源
     * @param params
     * @param pager
     * @return
     */
    @ResponseBody
    @PostMapping("/getGasSecretary")
    public JsonResult getGasSecretary(@RequestBody Map<String,Object> params, Pager pager){
        return seGasMeterExtService.getGasSecretary(params,pager);
    }


    /**
     * 秘书抄燃气的房源
     * @param params
     * @param
     * @return
     */
    @ResponseBody
    @PostMapping("/addGasClerk")
    public JsonResult addGasClerk(@RequestBody Map<String,Object> params){
        return seGasMeterExtService.addGasClerk(params);
    }



    /**
     * 管家退租查上期燃气
     * @param params
     * @param
     * @return
     */
    @ResponseBody
    @PostMapping("/getLastGasLease")
    public JsonResult getLastGasLease(@RequestBody Map<String,Object> params){
        return seGasMeterExtService.getLastGasLease(params);
    }

}
